package com.pureut.production.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pureut.production.domain.CutOrdersDocument;
import com.pureut.production.domain.CutOrdersDocumentDetail;
import com.pureut.production.domain.dto.CutOrdersDocumentDetailDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/***
 * 分切制令单明细 mapper
 * Author:C
 * Date:2023/02/16 16:20
 * @DESC
 */
@Mapper
public interface CutOrdersDocumentDetailMapper extends BaseMapper<CutOrdersDocumentDetail> {

    /**
     * 制令单明细列表
     */
    List<CutOrdersDocumentDetailDto> getList(String documentNum);

    /**
     * 获取单个制令单
     */
    CutOrdersDocumentDetailDto getDetailByDocumentNum(String documentNum);

    /**
     * 根据产品号码获取单个明细
     */
    List<CutOrdersDocumentDetailDto> getViewByProductNumber(String productNumber);

    /**
     * 修改卷长
     * @param masterVolumeNumber
     * @return
     */
    boolean editCutOrdersRollLengthChange(@Param("masterVolumeNumber") String masterVolumeNumber, @Param("rollLength") double rollLength);

    /**
     * 根据母卷号码删除制令单明细
     * @param masterVolumeNumber
     * @return
     */
    int deleteCutOrdersInfoById(String masterVolumeNumber);

    /**
     * 查询母卷是否分切
     * @param masterVolumeNumber
     * @return
     */
    CutOrdersDocumentDetailDto getCutOrdersDocumentInfo(String masterVolumeNumber);
}
